<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>EOS.IO: contracts/infinite/infinite.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="eos-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">EOS.IO
   &#160;<span id="projectnumber">DAWN3.0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_ae9b15dd87e066e1908bbd90e8f38627.html">contracts</a></li><li class="navelem"><a class="el" href="dir_da2258ea5bfae2641df967be076d9dbe.html">infinite</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">infinite.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="infinite_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="eos_8hpp.html">eoslib/eos.hpp</a>&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="token_8hpp.html">eoslib/token.hpp</a>&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="db_8hpp.html">eoslib/db.hpp</a>&gt;</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceinfinite.html">infinite</a> {</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno"><a class="line" href="namespaceinfinite.html#a178bfd89741210daf785c0d820a70fe8">   11</a></span>&#160;   <span class="keyword">typedef</span> <a class="code" href="structeosio_1_1token.html">eosio::token&lt;uint64_t,N(currency)&gt;</a> <a class="code" href="namespaceinfinite.html#a178bfd89741210daf785c0d820a70fe8">currency_tokens</a>;</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="structinfinite_1_1transfer.html">   17</a></span>&#160;   <span class="keyword">struct </span><a class="code" href="structinfinite_1_1transfer.html">transfer</a> {</div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="structinfinite_1_1transfer.html#a3f0c0b9180f6628d8954b390818b9a9e">   18</a></span>&#160;      <a class="code" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a>       <a class="code" href="structinfinite_1_1transfer.html#a3f0c0b9180f6628d8954b390818b9a9e">from</a>;</div><div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="structinfinite_1_1transfer.html#a9a61c1d9e877eb8602ee2cd05409ef86">   19</a></span>&#160;      <a class="code" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a>       <a class="code" href="structinfinite_1_1transfer.html#a9a61c1d9e877eb8602ee2cd05409ef86">to</a>;</div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="structinfinite_1_1transfer.html#a2b72eb47bcc8f3221dd5a622c0169e63">   20</a></span>&#160;      currency_tokens    <a class="code" href="structinfinite_1_1transfer.html#a2b72eb47bcc8f3221dd5a622c0169e63">quantity</a>;</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;   };</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="structinfinite_1_1account.html">   26</a></span>&#160;   <span class="keyword">struct </span><a class="code" href="structinfinite_1_1account.html">account</a> {</div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="structinfinite_1_1account.html#abd9362b588e409e7a8f7e0050cb45eab">   27</a></span>&#160;      <a class="code" href="structinfinite_1_1account.html#abd9362b588e409e7a8f7e0050cb45eab">account</a>( currency_tokens b = <a class="code" href="namespaceinfinite.html#a178bfd89741210daf785c0d820a70fe8">currency_tokens</a>() ):balance(b){}</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="structinfinite_1_1account.html#a2672b8f2e1f22073750f47d6cb092496">   32</a></span>&#160;      <span class="keyword">const</span> <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>     key = <a class="code" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(<a class="code" href="structinfinite_1_1account.html">account</a>);</div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="structinfinite_1_1account.html#a36c9678d7f96fcd20aa8f9ff89ac57c1">   33</a></span>&#160;      currency_tokens    <a class="code" href="structinfinite_1_1account.html#a36c9678d7f96fcd20aa8f9ff89ac57c1">balance</a>;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="structinfinite_1_1account.html#ae3aed9d0907ff88520f666ec23e83456">   35</a></span>&#160;      <span class="keywordtype">bool</span>  <a class="code" href="structinfinite_1_1account.html#ae3aed9d0907ff88520f666ec23e83456">is_empty</a>()<span class="keyword">const  </span>{ <span class="keywordflow">return</span> balance.<a class="code" href="structeosio_1_1token.html#a41378f3d965a9e6a3b2c9be37c132b2f">quantity</a> == 0; }</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;   };</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;   static_assert( <span class="keyword">sizeof</span>(<a class="code" href="structinfinite_1_1account.html">account</a>) == <span class="keyword">sizeof</span>(<a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>)+<span class="keyword">sizeof</span>(currency_tokens), <span class="stringliteral">&quot;unexpected packing&quot;</span> );</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="namespaceinfinite.html#a247d38a8fa9638b2221442d0dd932774">   39</a></span>&#160;   <span class="keyword">using</span> <a class="code" href="structeosio_1_1table.html">accounts</a> = <a class="code" href="structeosio_1_1table.html">eosio::table&lt;N(currency),N(currency),N(account),account,uint64_t&gt;</a>;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="namespaceinfinite.html#af0a30f8ccb62a1a5ff5851fe0c740e39">   50</a></span>&#160;   <span class="keyword">inline</span> <a class="code" href="structinfinite_1_1account.html">account</a> <a class="code" href="namespaceinfinite.html#af0a30f8ccb62a1a5ff5851fe0c740e39">get_account</a>( <a class="code" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a> owner ) {</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;      <a class="code" href="structinfinite_1_1account.html">account</a> owned_account;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;      <a class="code" href="structeosio_1_1table.html#aa21c1502397afb2cd3952e799fc391c0">accounts::get</a>( owned_account, owner );</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;      <span class="keywordflow">return</span> owned_account;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;   }</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;} </div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div><div class="ttc" id="structinfinite_1_1transfer_html_a9a61c1d9e877eb8602ee2cd05409ef86"><div class="ttname"><a href="structinfinite_1_1transfer.html#a9a61c1d9e877eb8602ee2cd05409ef86">infinite::transfer::to</a></div><div class="ttdeci">account_name to</div><div class="ttdef"><b>Definition:</b> infinite.hpp:19</div></div>
<div class="ttc" id="group__types_html_gaf9c1edb0e0da55ec6ba09f32f6839529"><div class="ttname"><a href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a></div><div class="ttdeci">#define N(X)</div><div class="ttdoc">used to generate a compile time uint64_t from the base32 encoded string interpretation of X ...</div><div class="ttdef"><b>Definition:</b> types.hpp:62</div></div>
<div class="ttc" id="namespaceinfinite_html_a178bfd89741210daf785c0d820a70fe8"><div class="ttname"><a href="namespaceinfinite.html#a178bfd89741210daf785c0d820a70fe8">infinite::currency_tokens</a></div><div class="ttdeci">eosio::token&lt; uint64_t, N(currency)&gt; currency_tokens</div><div class="ttdef"><b>Definition:</b> infinite.hpp:11</div></div>
<div class="ttc" id="namespaceinfinite_html"><div class="ttname"><a href="namespaceinfinite.html">infinite</a></div><div class="ttdoc">defines transfer struct (abi) </div><div class="ttdef"><b>Definition:</b> infinite.cpp:7</div></div>
<div class="ttc" id="group__types_html_ga3b44deb4b3b8d6ebab339d1263692117"><div class="ttname"><a href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a></div><div class="ttdeci">uint64_t account_name</div><div class="ttdef"><b>Definition:</b> types.h:35</div></div>
<div class="ttc" id="group__types_html_gaaa5d1cd013383c889537491c3cfd9aad"><div class="ttname"><a href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a></div><div class="ttdeci">unsigned long long uint64_t</div><div class="ttdef"><b>Definition:</b> types.h:18</div></div>
<div class="ttc" id="structinfinite_1_1account_html_abd9362b588e409e7a8f7e0050cb45eab"><div class="ttname"><a href="structinfinite_1_1account.html#abd9362b588e409e7a8f7e0050cb45eab">infinite::account::account</a></div><div class="ttdeci">account(currency_tokens b=currency_tokens())</div><div class="ttdef"><b>Definition:</b> infinite.hpp:27</div></div>
<div class="ttc" id="structinfinite_1_1transfer_html"><div class="ttname"><a href="structinfinite_1_1transfer.html">infinite::transfer</a></div><div class="ttdef"><b>Definition:</b> infinite.hpp:17</div></div>
<div class="ttc" id="token_8hpp_html"><div class="ttname"><a href="token_8hpp.html">token.hpp</a></div><div class="ttdoc">Defines types and ABI for standard token messages and database tables. </div></div>
<div class="ttc" id="structeosio_1_1token_html"><div class="ttname"><a href="structeosio_1_1token.html">eosio::token&lt; uint64_t, N(currency)&gt;</a></div></div>
<div class="ttc" id="eos_8hpp_html"><div class="ttname"><a href="eos_8hpp.html">eos.hpp</a></div></div>
<div class="ttc" id="structeosio_1_1token_html_a41378f3d965a9e6a3b2c9be37c132b2f"><div class="ttname"><a href="structeosio_1_1token.html#a41378f3d965a9e6a3b2c9be37c132b2f">eosio::token::quantity</a></div><div class="ttdeci">NumberType quantity</div><div class="ttdoc">Quantity of tokens available. </div><div class="ttdef"><b>Definition:</b> token.hpp:58</div></div>
<div class="ttc" id="structinfinite_1_1account_html"><div class="ttname"><a href="structinfinite_1_1account.html">infinite::account</a></div><div class="ttdoc">row in account table stored within each scope </div><div class="ttdef"><b>Definition:</b> infinite.hpp:26</div></div>
<div class="ttc" id="namespaceinfinite_html_af0a30f8ccb62a1a5ff5851fe0c740e39"><div class="ttname"><a href="namespaceinfinite.html#af0a30f8ccb62a1a5ff5851fe0c740e39">infinite::get_account</a></div><div class="ttdeci">account get_account(account_name owner)</div><div class="ttdef"><b>Definition:</b> infinite.hpp:50</div></div>
<div class="ttc" id="db_8hpp_html"><div class="ttname"><a href="db_8hpp.html">db.hpp</a></div></div>
<div class="ttc" id="structinfinite_1_1transfer_html_a2b72eb47bcc8f3221dd5a622c0169e63"><div class="ttname"><a href="structinfinite_1_1transfer.html#a2b72eb47bcc8f3221dd5a622c0169e63">infinite::transfer::quantity</a></div><div class="ttdeci">currency_tokens quantity</div><div class="ttdef"><b>Definition:</b> infinite.hpp:20</div></div>
<div class="ttc" id="structeosio_1_1table_html"><div class="ttname"><a href="structeosio_1_1table.html">eosio::table</a></div><div class="ttdef"><b>Definition:</b> db.hpp:179</div></div>
<div class="ttc" id="structinfinite_1_1account_html_ae3aed9d0907ff88520f666ec23e83456"><div class="ttname"><a href="structinfinite_1_1account.html#ae3aed9d0907ff88520f666ec23e83456">infinite::account::is_empty</a></div><div class="ttdeci">bool is_empty() const</div><div class="ttdef"><b>Definition:</b> infinite.hpp:35</div></div>
<div class="ttc" id="structeosio_1_1table_html_aa21c1502397afb2cd3952e799fc391c0"><div class="ttname"><a href="structeosio_1_1table.html#aa21c1502397afb2cd3952e799fc391c0">eosio::table::get</a></div><div class="ttdeci">static bool get(const PrimaryType &amp;p, Record &amp;r, uint64_t s=scope)</div><div class="ttdoc">Fetches a record from the table. </div><div class="ttdef"><b>Definition:</b> db.hpp:377</div></div>
<div class="ttc" id="structinfinite_1_1account_html_a36c9678d7f96fcd20aa8f9ff89ac57c1"><div class="ttname"><a href="structinfinite_1_1account.html#a36c9678d7f96fcd20aa8f9ff89ac57c1">infinite::account::balance</a></div><div class="ttdeci">currency_tokens balance</div><div class="ttdef"><b>Definition:</b> infinite.hpp:33</div></div>
<div class="ttc" id="structinfinite_1_1transfer_html_a3f0c0b9180f6628d8954b390818b9a9e"><div class="ttname"><a href="structinfinite_1_1transfer.html#a3f0c0b9180f6628d8954b390818b9a9e">infinite::transfer::from</a></div><div class="ttdeci">account_name from</div><div class="ttdef"><b>Definition:</b> infinite.hpp:18</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
